<html>
 <head>
        <title>[var.TITLE]</title>
        <link href="[var.ROOT_CSS_DIR]/main.css" rel="STYLESHEET" type="text/css" charset="iso-8859-1" hreflang="en-us">
        <link href="[var.ROOT_CSS_DIR]/facet/style.css" rel="STYLESHEET" type="text/css" charset="iso-8859-1" hreflang="en-us">
        <script type="text/javascript" src="[var.ROOT_DIR]js/common.js"></script>
        <script type="text/javascript" src="[var.ROOT_DIR]js/doiMenuDOM.js"></script>
        <script type="text/javascript" src="[var.ROOT_DIR]js/functions.js"></script>
        <script type="text/javascript" src="[var.ROOT_DIR]js/jsmenu.php"></script>
        <script type="text/javascript" src="[var.ROOT_DIR]js/jsmenu.cfg"></script>
        <script type="text/javascript" src="[var.ROOT_DIR]js/jsformgrid.php?session=[var.SessionVar]"></script>
        <script type="text/javascript" src="[var.ROOT_DIR]js/jsmasks.js"></script>
        <script type="text/javascript" src="[var.ROOT_DIR]js/jsverify.php?session=[var.SessionVar]"></script>
        <script type="text/javascript" src="[var.ROOT_DIR]js/jsinit.php?session=[var.SessionVar]"></script>
        <script type="text/javascript" src="[var.ROOT_DIR]js/jquery.js"></script>
        <script type="text/javascript" src="[var.ROOT_DIR]js/jsformgridnew.js"></script>
        <script type="text/javascript">
       
		function VerifyForm(valForm) {
		
			var errmessage = '';
			var rpc_errmessage = '';				
			var vproject_group_id = document.[var.HTMLFormName].project_group_id.value;
			var vproject_name = document.[var.HTMLFormName].project_name.value;
			var vproject_location = document.[var.HTMLFormName].project_location.value;
			var vproject_owner = document.[var.HTMLFormName].project_owner.value;
			var error = 0;
			
			if (vproject_name.length==0) 
			{
			   errmessage += 'Project is required!\n';
			   document.[var.HTMLFormName].project_name.focus();last_focus=1;
			   error = 1;
			}
			
			if (vproject_group_id.length==0) 
			{
				errmessage += 'Project Classification is required!\n';
				document.[var.HTMLFormName].project_group_id.focus();last_focus=1;
				error = 1;
			}
					
			if (vproject_location.length==0) 
			{
				errmessage += 'Project Location is required!\n';
				document.[var.HTMLFormName].project_location.focus();last_focus=1;
				error = 1;
			}
						
					
			if (vproject_owner.length==0) 
			{
				errmessage += 'Project Owner is required!\n';
				document.[var.HTMLFormName].project_owner.focus();last_focus=1;
				error = 1;
			}
			
			
			if(error > 0)
			{				
				alert(errmessage);
			}
			
			else if(error <= 0)
			{
				valForm.submitted = true; return true;
			}
			
	    }
        </script> 
 </head>
 <body bgcolor="FFFFFF" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">

         <table border="0" cellspacing="0" cellpadding="0" width="100%" align="[var.POSITION]">
                <tr>
                        <td>[tbs_include.onshow;file=[var.HTMLHeader];getob;]</td>
                </tr>
                <tr>
                        <td>
                        <table border="0" cellspacing="0" cellpadding="0" width="100%">
                                <tr>
                                        <td class="mainmenu2"><img src="images/spacer.gif" height="1" width="1"></td>
                                </tr>
                                <tr>
                                        <td background="[var.ROOT_IMG_DIR]/back-menu.gif">
                                        <table border="0" cellspacing="0" cellpadding="0" width="100%">
                                                <tr>
                                                        <td>
                                                        <script language="JavaScript" type="text/JavaScript">menu.Build();</script>
                                                  </td>
                                                  <td class="head-login">Login as [var.USERPROFILE_NAME]</td>
                                                </tr>
                                          </table>
                                        </td>
                                </tr>
                                <tr>
                                        <td class="mainmenu2"><img src="images/spacer.gif" height="1" width="1"></td>
                                </tr>
                        </table>
                        </td>
                </tr>
                <tr height="100%">
                        <td>
                        <table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
                                <tr valign="top">
                                        <td width="100%">
                                                <table border="0" cellspacing="0" cellpadding="0" width="100%">
                                                        <tr>
                                                                <td class="head-path"></td>
                                                                <td class="corner-date">[var.CORNER_DATE]</td>
                                                        </tr>
                                                </table>
                                                <table border="0" cellspacing="0" cellpadding="5" width="100%">
                                                        <tr>
                                                                <td class="FacetHeaderContent" >.:[var.SubHeaderTitle]:.</td>
                                                        </tr>
                                                </table>

                                                <table border="0" cellspacing="0" cellpadding="5" width="100%">
                                                <form method="post" action="[var.FormAction]" name="[var.HTMLFormName]" ONSUBMIT="if (this.submitted) return true; else return false;">
                                                        <tr>
                                                          <td class="contentTitleMarketing">
                                                                Menu
                                                          </td>
                                                        </tr>
                                                        <tr>
                                                          <td class="contentMarketing">

                                                                <table cellspacing="2" cellpadding="0">
                                                                 <tr>
                                                                   <td>
                                                                    <input type="button" name="Action" value="<<Back" class="button" onClick="self.location.replace('[sys.script_name]')">
                                                                   </td>
                                                                   <td>
																	 <input name="FormAction" type="submit" value="Save" class="button" ONCLICK="VerifyForm(this.form);">
																   </td>
                                                                   <td>
                                                                    <input type="button" name="Action" value="Done" class="button" onClick="self.location.replace('[var.SERVER_URL]')">
                                                                   </td>
                                                                 


                                                                 </tr>
                                                                </table>
                                                          </td>
                                                        </tr>
                                                        <tr>
                                                          <td class="contentMarketing">
                                                        <!-- FORM SECTION -->
                                                        
															<table width="90%" border="0">
																<tr>
																
																	<!--Header Column-->
																	<td width="50%" valign="top"> 
																	   
																	     <table border="0" cellspacing="0" cellpadding="0" align="left" width="90%">
                                                        
																			  <tr>
																				<td class="fieldCaption" align="right">Prospect ID</td>
																				<td class="fieldCaption">:</td>
																				<td class="fieldCaption">[var.project_id]
																					
																					[tbs_check;htmlconv=no;if [var.project_id]!='';then
																					'<input type="text" name="project_id" value="[headblv.project_id;noerr]" maxlength="255" size="10" class="input" "readonly">'
																					;else 'AUTO NUMBERED BY SYSTEM <input type="hidden" name="project_id" value="AUTO NUMBERED BY SYSTEM">']
																				    																
																				</td>
																				<!--<td class="fieldCaption"><input type="text" name="(bln.project_id)" value="[headblv.project_id;noerr]" maxlength="255" size="10" onblur='[var.InitFunction]' onkeyup="this.value=this.value.toUpperCase()" class="input" [tbs_check;if [var.FormMode]=Edit;then 'readonly';else '']></td>-->
																			  </tr>
																			  <tr>
																				<td class="fieldCaption" align="right">Prospect Name</td>
																				<td class="fieldCaption">:</td>
																				<td class="fieldCaption"><input type="text" name="project_name" value="[headblv.project_name;noerr]" size="30" class="input" onKeyUp="this.value=this.value.toUpperCase()"></td>
																			  </tr>
																			  <tr>
																				<td class="fieldCaption" align="right">No. of Contract</td>
																				<td class="fieldCaption">:</td>
																				<td class="fieldCaption"><input type="text" name="no_contract" value="[headblv.no_contract;noerr]" size="30" class="input"></td>
																			  </tr>																			  
																			  <tr>
																				<td class="fieldCaption" align="right">Est. Start Date</td>
																				<td class="fieldCaption">:</td>
																				<td class="fieldCaption">

																					<input type="text" name="start_date"  maxlength="255" size="20" class="input" value="[tbs_check;if [var.FormMode]=Edit;then [headblv.start_date;frm='dd/mm/yyyy';noerr]; else [sys.now;frm='dd/mm/yyyy']]" maxlength="255" class="input" >
																					<a href="javascript:void(0)" onclick="gfPop.fPopCalendar([var.HTMLFormName].start_date);return false;" hidefocus>
																					<img name="popcal" align="absMiddle" src="[var.ROOT_DIR]js/Calendar/pop/calbtn.gif" width="34" height="22" border="0" alt=""></a>

																				</td>
																			  </tr>
																			  <tr>
																				<td class="fieldCaption" align="right">Est. End Date</td>
																				<td class="fieldCaption">:</td>
																				<td class="fieldCaption">

																					<input type="text" name="end_date"  maxlength="255" size="20" class="input" value="[tbs_check;if [var.FormMode]=Edit;then [headblv.end_date;frm='dd/mm/yyyy';noerr]; else [sys.now;frm='dd/mm/yyyy']]" maxlength="255" class="input" >
																					<a href="javascript:void(0)" onclick="gfPop.fPopCalendar([var.HTMLFormName].end_date);return false;" hidefocus>
																					<img name="popcal" align="absMiddle" src="[var.ROOT_DIR]js/Calendar/pop/calbtn.gif" width="34" height="22" border="0" alt=""></a>

																				</td>
																			  </tr>
																			  
																			  <tr>
																				<td class="fieldCaption" align="right">Volume Budget </td>
																				<td class="fieldCaption">:</td>
																				<td class="fieldCaption">
																					<input type="text" name="budget_volume" value="[headblv.budget_volume;noerr]" size="30" class="input">
																					cbm
																				</td>
																			  </tr>
																			  
																			  <tr>
																				<td class="fieldCaption" align="right">Weight Budget </td>
																				<td class="fieldCaption">:</td>
																				<td class="fieldCaption">
																					<input type="text" name="budget_berat" value="[headblv.budget_berat;noerr]" size="30" class="input">
																					ton
																				</td>
																			  </tr>
																			  

																			 <!--Edited by Adit van Smith-->

																		</table>
																	   
																	</td>
																	<!--End Header Column-->
																	
																	
																	<!--Header Column-->
																	<td width="50%" valign="top">  
																	   
																	     <table border="0" cellspacing="0" cellpadding="0" align="left" width="90%">
                                                        
																			  <tr>
																				<td class="fieldCaption" align="right">Prospect Classification</td>
																				<td class="fieldCaption">:</td>
																				<td class="fieldCaption">																					
																					[var.select_projgroup;htmlconv=no;]
																				</td>
																			  </tr>
																			  <tr>
																				<td class="fieldCaption" align="right">Prospect Location</td>
																				<td class="fieldCaption">:</td>
																				<td class="fieldCaption"><input type="text" name="project_location" value="[headblv.project_location;noerr]" size="30" class="input" onKeyUp="this.value=this.value.toUpperCase()"></td>
																			  </tr>
																			  <tr>
																				<td class="fieldCaption" align="right">Prospect Remarks</td>
																				<td class="fieldCaption">:</td>
																				<td class="fieldCaption"><input type="text" name="project_remarks" value="[headblv.project_remarks;noerr]" size="30" class="input" onKeyUp="this.value=this.value.toUpperCase()"></td>
																			  </tr>
																			  <tr>
																				<td class="fieldCaption" align="right">Prospect Owner</td>
																				<td class="fieldCaption">:</td>
																				<td class="fieldCaption"><input type="text" name="project_owner" value="[headblv.project_owner;noerr]" size="30" class="input" onKeyUp="this.value=this.value.toUpperCase()"></td>
																			  </tr>
																			  
																			 <tr>
																				<td class="fieldCaption" align="right">Revenue Budget </td>
																				<td class="fieldCaption">:</td>
																				<td class="fieldCaption">
																					<input type="text" name="budget_revenue" value="[headblv.budget_revenue;noerr;frm='0,000.00']" size="15" class="input" onkeyup="maskMode(this.name,this.value);">
																					rupiah
																				</td>
																			  </tr>
																			  
																			  <tr>
																				<td class="fieldCaption" align="right">Shipment Budget </td>
																				<td class="fieldCaption">:</td>
																				<td class="fieldCaption">
																					<input type="text" name="budget_shipping" value="[headblv.budget_shipping;noerr]" size="30" class="input">
																				</td>
																			  </tr>

																		</table>
																	   
																	</td>
																	<!--End Header Column-->
																
																</tr>
															</table>
                                                         
                                                         
                                                         
                                                         <!-- FORM SECTION -->
                                                                </td>
                                                        </tr>
                                                </table>
                                                
                                                <!--GRID-->
                                                
                                                <hr size="1" color="DFDFDF">
                                                <div id="spanHeader" style="height: 25px; vertical-align: top; overflow-y: noscroll;">
                                                 
                                              
                                                <table border="0" width="100%" cellpadding="3" cellspacing="1" class="FacetFormTABLEMarketing" align="left">
                                                
                                                        <tr>
                                                                <td nowrap class="FacetColumnTDMarketing" align="center" width="35">X</td>
                                                                <td nowrap class="FacetColumnTDMarketing" align="center" width="45">No.</td>
                                                                <td nowrap class="FacetColumnTDMarketing" align="center">Customer</td>
                                                        </tr>
                                                      
                                                </table>
                                                </div>
                                                
                                                 <div id="spanHeader" style="height: 25px; vertical-align: top; overflow-y: noscroll;">
                                               <table border="0" width="100%" cellpadding="3" cellspacing="1" class="FacetFormTABLEMarketing" align="left">
                                                
                                                        <tr>
                                                                <td nowrap class="FacetColumnTDMarketing" align="center" width="187">&nbsp;</td> 
                                                                <td nowrap class="FacetColumnTDMarketing" align="center" width="145">Code</td>
                                                                <td nowrap class="FacetColumnTDMarketing" align="center" width="318">Name</td>
                                                                <td nowrap class="FacetColumnTDMarketing" align="center">&nbsp;</td>
                                                        </tr>
                                                      
                                                </table>
                                            </div>




                                                <div id="spanDetail" class="tariffgrid">

                                                    <!--Edited by van Smith-->

                                                    <table border="0" width="100%" cellpadding="3" cellspacing="1" class="FacetFormTABLEMarketing" align="left">
                                                    
                                                        <tr id="[blg.#]" style="display:[blg._display;noerr]">

                                                                <td nowrap class="FacetDataTDMarketing" align="center" width="35">
                                                                  <input type="checkbox" name="txtCheck[blg.#]" value="[blg.id;noerr]" class="inputRadio">                                                                 
                                                                  <input type=hidden name="dk[blg.#]" value="D">
                                                                </td>
                                                                <td nowrap class="FacetDataTDMarketing" align="right" width="45" align="right">
                                                                [blg.#;block=tr].
                                                                <input type="hidden" name="project_id[blg.#]" value="[tbs_check;if [var.project_id;noerr]!='';then [var.project_id;noerr] ;else '']">
                                                                </td>

                                                                <td class="FacetDataTDMarketing" align="left" width="570">
                                                                     
                                                                     <!--<input type="text" name="tes_[blg.#]" id="[blg.#]" class="textBox">--->
                                                                                                                                                                                                               
                                                                     <select name="debturList[blg.#]" class="gridBox" id="input" onchange="GetReceived(this.value,'[blg.#]');">
																		<option value="" selected>Select Value</option>
																		<option value="1">Customer</option>
																	 </select>
																	 <input type="text" name="debtur[blg.#]" value="[blg.debtur;noerr]" id="input" class="counted" width="13">
																	 <input type="text" name="debnam[blg.#]" value="[blg.debnam;noerr]" maxlength="255" size="30" class="input">
																	 
                                                                </td>
                                                                
                                                                <td class="FacetDataTDMarketing" align="left">
                                                                   &nbsp;
                                                                </td>

                                                            </tr>
                                                    </table>

                                                    <!--End Edited by van Smith-->

                                                </div>

                                                <!--END GRID-->
                                                
                                                <!--BUTTON-->
                                                <div id="spanButton" style="height: 35px; vertical-align: top; overflow-y: noscroll;">
                                                <table border="0" width="100%" cellpadding="3" cellspacing="1" class="FacetFormTABLEMarketing" align="left">
                                                        <tr>
                                                            <td align="right" class="FacetColumnTDMarketing">

                                                                   <table border="0" cellspacing="2" cellpadding="0">
                                                                           <tr>
                                                                                   <td>
                                                                                     <input name="FormAction" type="submit" value="Next Line" class="button" onClick="return (AddFormGridProject(this,'[var.HTMLFormName].debturList'))">
                                                                                   </td>
                                                                                   <td>
                                                                                     <input name="FormAction" type="submit" value="Save" class="button" ONCLICK="VerifyForm(this.form);">
                                                                                   </td>
                                                                                   <!--
                                                                                   <td>[tbs_check;block=td;if [var.USER_CANDELETE]=1]
																					<input type="button" name="Action" value="Delete" class="button" onClick="if (confirm('Are you sure want to delete ?')) {document.[var.HTMLFormName].action='[sys.script_name]?FormAction=Delete&[var.PRIMARY_KEY]=[var.PRIMARY_VALUE]&PageMode=Form&form=[var.HTMLFormName]';[var.HTMLFormName].submit();}">
																				   </td>
																				   -->
                                                                                   <td>
                                                                                     <input name="FormAction" type="submit" value="Cancel" class="button" onClick="self.location.replace('[sys.script_name]')">
                                                                                   </td>
                                                                           </tr>
                                                                   </table>


                                                            </td>
                                                                </td>
                                                        </tr>
                                                        </form>
                                                </table>
                                                </div>
                                                
                                                <!--END BUTTON-->
                                                
                                                
                                        </td>
                                </tr>
                        </table>
                        </td>
                </tr>

                <tr>
                        <td>
                        <br>
                        <table border="0" cellspacing="0" cellpadding="0" width="100%">
                                <tr>
                                        <td class="footer1"><img src="images/spacer.gif" height="1" width="1"></td>
                                </tr>
                                <!--tr>
                                        <td class="footer2">Prototype Test - Web Application</td>
                                </tr-->
                        </table>
                        </td>
                </tr>
         </table>
 </body>
<iframe width="174" height="189" name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="[var.ROOT_DIR]js/Calendar/pop/ipopeng.htm" scrolling="no" frameborder="0" style="LEFT: -500px; POSITION: absolute; TOP: 0px; VISIBILITY: visible; Z-INDEX: 999"></iframe>
 <script>

 $(document).ready(function(){
    $('#njajal2').blur(function(){
            alert( $('#njajal').html() );
    });
});

 [var.InitFunction]
 SetDK(1,'K');
 document.[var.HTMLFormName].total_trans.value = SumTotal("jumlah");

 function SetDK(idx,val) {
   //eval("dk = document.[var.HTMLFormName].dk"+idx+".value;");
   //if (dk=='') eval("document.[var.HTMLFormName].dk"+idx+".value='"+val+"';");
   alert("aa");
   return true;
 }



 function GetReceived(val,no_urut) {
	 
	 var debcount = "";
	  	
	 $(document).ready(function(){
        			  
		$(".counted:visible").each(function(n) {			
			
			if(this.value != "")
			{
			  debcount+=$.trim(this.value)+"-";
			}
		});
    		
	});	  
    newwin = window.open("ais_transaction_custlist_2.php?FormName=[var.HTMLFormName]&no_urut="+no_urut+"&debcount="+debcount,"toolcalc","height=400,width=640,noscroll,resizable");             
 }



 // added by Adit van Smith <adit.smith@gmail.com> 
 

function maskMode(names,values){
    //alert(tes);
    oMask2 = new Mask('#,###.##', 'number');
    $("input[name="+names+"]").val(oMask2.format(values));

 }


var reccount = 1;
//if (reccount==0) reccount=1; else reccount=5;
var last;

function AddFormGridProject (cname,firstelemen) {
    if (VerifyGridProject(reccount)==false) {
        return false
    }

    $(".gridBox:visible").each(function(n) {
        n = n+1;
        reccount = n;
    });

    //reccount = 5;
    reccount = parseInt(reccount)+1;

    //alert("reccount: " + reccount);

    if (reccount>=100) {
        cname.disabled = true;
    }

    var objrow = document.getElementById(reccount);

    if (objrow.style.display == 'none') {
        objrow.style.display = '';
    }

    eval(firstelemen+''+reccount+'.focus()');

    return false;
}

/*
function AddFormGridProject (cname,firstelemen) {
    if (VerifyGridProject(reccount)==false) {
        return false
    }

    $(".textBox:visible").each(function(n) {
        n = n+1;
        reccount = n;
    });

    //reccount = 5;
    reccount = parseInt(reccount)+1;

    //alert("reccount: " + reccount);

    if (reccount>=100) {
        cname.disabled = true;
    }

    var objrow = document.getElementById(reccount);

    if (objrow.style.display == 'none') {
        objrow.style.display = '';
    }

    eval(firstelemen+''+reccount+'.focus()');

    return false;
}
*/


function VerifyGridProject (x) {
    err_message = '';
    last_focus =0;
    if (err_message.length) {//alert(err_message);
    return false} else return true
}

function CheckAllGrid(firstelemen) {
        for (n=1;n<reccount;n++) {
                if (!VerifyGrid(n)) return false;
        }
        eval('fl = document.'+firstelemen+reccount+'.value');
        if (fl.length)
                if (!VerifyGrid(reccount)) return false;
return true;}

 </script>
</html>
